<template>
   <div class="nowshow">

    <div ref="moviesScroll" class="list">
       <div class="wrap">
      <Item v-for="item in movies.movieList" :key="item.id" :movie="item"></Item>
    </div>
    </div>
   
    
  </div>
 
</template>


<script>
import Item from "../hostshow/Item";
import { get, post } from "../../../api/http";
import BScroll from "@better-scroll/core";
import Pullup from "@better-scroll/pull-up";
import {mapMutations} from 'vuex'
BScroll.use(Pullup);
export default {
  components: {
    Item,
  },
  data() {
    return {
      movies: {
        pagesize: 10,
        start: 0,
        hasMore: true,
        movieIds: [],
        movieList: [],
      },
    };
  },
  created() {
    this.getMovielist();
  },
  methods: {
    async getMovielist() {
      let rs = await get("/ajax/movieOnInfoList", {});
      this.movies.movieList.push(...rs.data.movieList);
      console.log(rs);
      this.$nextTick(() => {
        this.setMoviesScroll();
      });
    },
    setMoviesScroll() {
    this.moviesScroll = new BScroll(this.$refs.moviesScroll, {
      scrollY: true,
      pullUpLoad: true,
    })
  }
}
  }
  
</script>

<style lang="scss" scoped>
.nowshow{
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  .list{
    flex: 1;
    overflow: hidden;
  }
}

</style>
